<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderUser extends Model
{
    //
    protected $table = 'order_user';

    public static function getStatusName($status){
        switch ($status){
            case 0:
                return '待核销';
            case 1:
                return '已核销';
            case 2:
                return '已退款';
            default:
                return '';
        }
    }


    public function order(){
        return $this->hasOne(Order::class,'id','order_id');
    }


    public function activity(){

        return $this->hasOne(Activity::class,'id','activity_id');
    }


}
